﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CPlatePrintSys.Application.ViewModels;
using CPlatePrintSys.Application.Views;
using CPlatePrintSys.Application.Services;
using CPlatePrintSys.Domain.Services;
using CPlatePrintSys.Infrastructure;
using Prism.Ioc;
using Prism.Modularity;
using Prism.Navigation.Regions;
using CPlatePrintSys.Infrastructure.Repositories;
using System.ComponentModel;
using CPlatePrintSys.DataAccess.Repositories;

namespace CPlatePrintSys.Application
{
    public class ApplicationModule : IModule
    {
        public void OnInitialized(IContainerProvider containerProvider)
        {

        }

        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            //< !--注册所有视图-- >
            containerRegistry.RegisterForNavigation<UserManagementView, UserManagementViewModel>();
            

            // 注册应用服务
            containerRegistry.Register<IUserRepository, UserRepository>();
            containerRegistry.Register<IUserService, UserService>();
            containerRegistry.Register<IGlobalConfigRepository, GlobalConfigRepository>();
            containerRegistry.Register<IGlobalConfigService, GlobalConfigService>();
            
            // 注册视图导航
            containerRegistry.RegisterForNavigation<ProcessSequenceCreateNewView, ProcessSequenceCreateNewModel>();
            containerRegistry.Register<IShipRepository, ShipRepository>();
            containerRegistry.Register<ShipInfoService>();
            containerRegistry.Register<IShipConfigService, ShipConfigService>();
            
            // 注册布局服务
            containerRegistry.Register<ILayoutService, LayoutService>();
            containerRegistry.Register<IPlateAnnotationInfoRepository, PlateAnnotationInfoRepository>();
        }
    }
}
